import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import './plugins/element.js'
import { Message } from "element-ui";
import 'view-design/dist/styles/iview.css'; //导入样式
import { Poptip, Button,Select,Option,InputNumber } from 'view-design';
import VueQuillEditor from 'vue-quill-editor'
import Http from './action/request'

import 'quill/dist/quill.core.css'
import 'quill/dist/quill.snow.css'
import 'quill/dist/quill.bubble.css'

Vue.use(VueQuillEditor)
Vue.component('Button', Button);
Vue.component('Poptip', Poptip);
Vue.component('Select', Select);
Vue.component('Option', Option);
Vue.component('InputNumber', InputNumber);
// 全局样式表
import '../src/assets/css/global.css'
import '../src/assets/css/iconfont.css'
import '../src/assets/css/common.css'

Vue.config.productionTip = false
// message 配置
Vue.prototype.$message = Message;
// 把Http 挂载到Vue 实例上
Vue.prototype.$Http = Http;
Vue.prototype.$store = store;

// 路由守卫
router.beforeEach((to , from , next ) =>{
  // console.log(to);
  // console.log(from);
  // if(to.meta.auth){
  //   if(store.state.token){
  //     Message({
  //       type:'error',
  //       message:'您还没登录哦'
  //     })
  //     next({
  //       path:'/login'
  //     })
  //   }else {
  //     next();
  //   }
  // }else {
  //   next()
  // };
  // if(store.state.token || to.path === '/login'){
  //   next()
  // } else {
  //   next({
  //     path:'/login'
  //   })
  // }
  next();
})
new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
